#ifndef __CLOUD_SYNC__
#define __CLOUD_SYNC__

#define SLEEP_TIME 30



/* 
  To be called during the initialization of the file system
  Should be immediately followed by a disk-scan & cloud-list and populating 
  the queue with the objects that are not in sync with the cloud storage
*/
void init_sync_queue ();

/*
  The main loop that runs in the background thread and is responsible
  for the syncing. Performs two main functions:
  - Fetches the list of all the objects in cloud, so as to keep track 
    of updates by other clients/users.
  - Syncs the objects in the sync_queue with the cloud.

  Both of these may be run at different frequencies (which should 
  ideally be a tunable pararmeter  
*/

void *sync_loop (void *unused_args);

/*
  Called for objects that need to be pushed to the cloud.
  This works only for on-disk objects. All objects need to be added
  to this queue, and the sync_loop no longer keeps scanning the disk
  cache for dirty objects.
*/
int push_to_sync_queue (const char *object_name);

/* 
  Pop should not be exposed to the world, because only the sync_loop
  will call pop, when the object has been synced with cloud 
*/

void destroy_sync_queue ();

#endif /* __CLOUD_SYNC__ */
